package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * ProjectContractor generated by hbm2java
 */
@Entity
@Table(name = "PROJECT_CONTRACTOR", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = {
		"PROJECT_ID", "CONTRACTOR_ID" }))
public class ProjectContractor implements java.io.Serializable {

	private ProjectContractorId id;
	private Objects objectsByProjectId;
	private Objects objectsByContractorId;

	public ProjectContractor() {
	}

	public ProjectContractor(ProjectContractorId id,
			Objects objectsByProjectId, Objects objectsByContractorId) {
		this.id = id;
		this.objectsByProjectId = objectsByProjectId;
		this.objectsByContractorId = objectsByContractorId;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "projectId", column = @Column(name = "PROJECT_ID", nullable = false)),
			@AttributeOverride(name = "contractorId", column = @Column(name = "CONTRACTOR_ID", nullable = false)) })
	public ProjectContractorId getId() {
		return this.id;
	}

	public void setId(ProjectContractorId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByProjectId() {
		return this.objectsByProjectId;
	}

	public void setObjectsByProjectId(Objects objectsByProjectId) {
		this.objectsByProjectId = objectsByProjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CONTRACTOR_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByContractorId() {
		return this.objectsByContractorId;
	}

	public void setObjectsByContractorId(Objects objectsByContractorId) {
		this.objectsByContractorId = objectsByContractorId;
	}

}
